<?php
/*
	本插件：$this->model('model')->方法名();
	其他地方调用：model('jy_h5ewm/model')->方法名();
*/
namespace jy_h5ewm;
defined('BY_JYA') or exit('error');
class model extends \plugin{
	public function upposter($post){
		$data=array(
			'poster'=>trim($post['poster']),
			'diyform'=>ijson_encode($post['diyform']),
		);
		$id=pdo_getcolumn('jy_h5ewm_poster',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid'],'listid'=>trim($post['listid'])),'id');
		if($id){
			pdo_update('jy_h5ewm_poster',$data,array('uniacid'=>$_SESSION['uniacid'],'id'=>$id));
		}else{
			$data['listid']=trim($post['listid']);
			$data['createtime']=TIMESTAMP;
			$data['mid']=$_SESSION['uid'];
			$data['uniacid']=$_SESSION['uniacid'];
			pdo_insert('jy_h5ewm_poster',$data);
		}
		return '';
	}
}
?>